
#include "Shm.hpp"
#include "namedPipe.hpp"


int main()
{
    // 创建共享内存
    Shm shm(g_pathname, g_proj_id, gUser);
    shm.Zero();
    char* shmaddr = (char*)shm.Addr();
    sleep(3);

    // 打开管道（用于保护 shm ）
    NamePipe fifo(comm_path, User);
    fifo.OpenForWrite();

    // 当成 string 
    char ch = 'A';
    while (ch <= 'Z')
    {
        shmaddr[ch - 'A'] = ch;
        ++ch;
        std::string temp = "wake up";
        fifo.WriteNamedPipe(temp);
        sleep(2);
    }

    return 0;
}
